Developer Documentation

QuickTime 4 API Documentation

Wired Movies and Sprites

| Previous | Chapter Contents | Chapter Top | Next |

Sprite Track Media Format

The sprite track media format is hierarchical and is based on QT atoms and atom containers. A sprite track sample is a QT atom container structure. For more information on QT atoms and atom containers, see Chapter 1, "Introduction to Wired Movies, Sprites, and the Sprite Toolbox." For more information about the sprite media format, see Appendix B in this book.

Figure 2-1 shows the high-level structure of a sprite track key frame sample. A key frame sample is represented by a QT atom container. Each atom in the atom container is represented by its atom type, atom ID, and, if it is a leaf atom, the type of its data.

Figure 1 A key frame sample atom container

The QT atom container contains one child atom for each sprite in the key frame sample. Each sprite atom has a type of kSpriteAtomType . The sprite IDs are numbered from one to the number of sprites defined by the key frame sample ( numSprites ).

Each sprite atom contains leaf atoms that define the properties of the sprite, as shown in Figure 2-2 . For example, the kSpritePropertyLayer property defines a sprite's layer. Each sprite property atom has an atom type that corresponds to the property and an ID of 1.

Figure 2 Atoms that describe a sprite and its properties

In addition to the sprite atoms, the QT atom container contains one atom of type kSpriteSharedDataAtomType with an ID of 1. The atoms contained by the shared data atom describe data that is shared by all sprites. The shared data atom contains one atom of type kSpriteImagesContainerAtomType with an ID of 1 ( Figure 2-3 ).

The image container atom contains one atom of type kImageAtomType for each image in the key frame sample. The image atom IDs are numbered from one to the number of images ( numImages ). Each image atom contains a leaf atom that holds the image data (type kSpriteImageDataAtomType ) and an optional leaf atom (type kSpriteNameAtomType ) that holds the name of the image.

Figure 3 Atoms that describe sprite images

Assigning Group IDs

Sprite Image Registration


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |